<?php

namespace Dreamcat\ConfigClient\Factory;

use Dreamcat\ConfigClient\Api\Impl\NacosServer;
use Dreamcat\ConfigClient\Api\NacosServerInterface;
use Dreamcat\ConfigClient\Logger\SimpleLogger;
use Dreamcat\ConfigClient\Popo\NacosAuthorization;

/**
 * -
 * @author vijay
 */
class NacosServerFactory
{
    /**
     * 构建服务对象
     * @return NacosServer
     */
    public static function buildServer(): NacosServerInterface
    {
        $server = new NacosServer("http://192.168.35.52:8848");
        $server->setLogger(new SimpleLogger());
        $user = new NacosAuthorization();
        $user->setPassword("crm")->setUserName("crm");
        $server->setAuthorization($user);
        return $server;
    }
}

# end of file
